

export default async function(template, list) {
  const hiprintTemplate = new hiprint.PrintTemplate({
    template: template,
  });
  hiprintTemplate.print(list, {}, {
    styleHandler: () => {
      const defaultUrl = `${import.meta.env.VITE_APP_ROUTER_BASE}/hiprint/print-lock.css`
      let css = `<link href="${import.meta.env.VITE_APP_ENV === 'production' ? (window._config.printCss || defaultUrl) : '/hiprint/print-lock.css'}" media="print" rel="stylesheet">`
      return css
    }
  })
}

